Skip to content

Conversation

iccicci
Copy link
Contributor

@iccicci iccicci commented Oct 3, 2025

Checklist

  • JIRA - LW-13680
  • Proper tests implemented
  • Screenshots added.

Proposed solution

Proposed the approach of a JSON encoded variable as after WebPack build we no longer have the power to dynamically access process.env.

Following code

for (const i of [1, 2, 3, 4]) console.log('feature', i, process.env[`FEATURE_${i}`]);
console.log('feature1', process.env.FEATURE_1);
console.log('feature2', process.env.FEATURE_2);
console.log('feature3', process.env.FEATURE_3);
console.log('feature4', process.env.FEATURE_4);

produces following logs

feature 1 undefined
feature 2 undefined
feature 3 undefined
feature 4 undefined
feature1 undefined
feature2 test
feature3 undefined
feature4 false

Proposed parsing as boolean as all FF have a boolean value. Ref: isFeatureFlagEnabled

Testing

Manually tested

@iccicci iccicci requested a review from a team as a code owner October 3, 2025 16:37
@lace-bot
Copy link
Collaborator

lace-bot commented Oct 3, 2025

Allure Report

allure-report-publisher generated test report!

processReports: ✅ test report for 044170ad

passed failed skipped flaky total result
Total 33 0 4 0 37

@iccicci iccicci force-pushed the feat/LW-13680-ff-override branch from 427c988 to ea0b673 Compare October 6, 2025 08:13
Copy link
Contributor

@mirceahasegan mirceahasegan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the solution.
Please add the new variable to .env.defaults and an example to .env.examples. It should be clear that the overide keys must be the lowercase versions:
FF_OVERRIDE='{"notifications-center": false}'
not
FF_OVERRIDE='{"NOTIFICATIONS_CENTER": false}'

@mirceahasegan
Copy link
Contributor

Example usage @ljagiela / @wklos-iohk : FF_OVERRIDE='{"notifications-center": "false"}' npm run build:dev

@iccicci iccicci force-pushed the feat/LW-13680-ff-override branch 3 times, most recently from c6ae00f to 3de9119 Compare October 7, 2025 14:37
@iccicci iccicci force-pushed the feat/LW-13680-ff-override branch from 3de9119 to 044170a Compare October 7, 2025 15:21
Copy link

sonarqubecloud bot commented Oct 7, 2025

Copy link
Contributor

@mirceahasegan mirceahasegan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fantastic work @iccicci 🥇

@iccicci iccicci merged commit 1cab032 into main Oct 9, 2025
27 checks passed
@iccicci iccicci deleted the feat/LW-13680-ff-override branch October 9, 2025 07:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants